var express = require('express')
var router = express.Router()

// middleware that is specific to this router
// 可以设置拦截器，进行权限判断
router.use(function timeLog (req, res, next) {
  console.log(`Time:${Date.now()}`)
  next()
})
router.post('/testOne', function (req, res) {
  res.send({
      url:"testOne",
      data:{
          code:200,
          msg:"测试接口一",
          time:`${Date.now()}`
      }
  });
});
router.post('/testTwo', function (req, res) {
  res.send({
      url:"testTwo",
      data:{
          code:200,
          msg:"测试接口二",
          time:`${Date.now()}`
      }
  });
});
router.post('/testThree', function (req, res) {
  res.send({
      url:"testThree",
      data:{
          code:200,
          msg:"测试接口三",
          time:`${Date.now()}`
      }
  });
});

module.exports = router